/*
 * ROM.h
 *
 *  Created on: 2011-3-1
 *      Author: Dallas Cao
 */

#ifndef ROM_H_
#define ROM_H_

#ifndef TYPEDEF_H_
#include "../Typedef.h"
#endif

#ifndef _STDIO_H
#include <stdio.h>
#endif

#define NES_TAG		"NES"
#define NFS_TAG		"NFS"

typedef struct tagNESHeader
{
	BYTE ID[4];
	BYTE Prg_Page_Size;
	BYTE Chr_Page_Size;
	BYTE control1;
	BYTE control2;
	BYTE reserved[8];
} NESHEADER;

class ROM
{
public:
	ROM(){};
	ROM(const char* romName);

	virtual ~ROM();

	BOOL loadRom(const char* romName);
	BOOL init();
    NESHEADER* getNESHeader()
    {
        return &m_NESHeader;
    }

protected:
	NESHEADER m_NESHeader;
};

#endif /* ROM_H_ */
